<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.w3.org/1999/xhtml">
<head>
	<meta charset="utf-8" />
	<title>面向研究团队的参考文献管理与服务分布式系统</title>
	<meta name="keywords" content="面向研究团队的参考文献管理与服务分布式系统" />
	<meta name="description" content="面向研究团队的参考文献管理与服务分布式系统" />
	<meta name="viewport" content="width=device-width, initial-scale=1.0" />

	<!-- basic styles -->
	
	<link href="/ma/css/bootstrap.min.css" rel="stylesheet" />
    <link href="/ma/css/bootstrap-table.css" rel="stylesheet" />
	<link href="/ma/css/bootstrap-editable.css" rel="stylesheet" />
	<link rel="stylesheet" href="/ma/css/font-awesome.min.css" />

	<!--[if IE 7]>
	  <link rel="stylesheet" href="/ma/css/font-awesome-ie7.min.css" />
	<![endif]-->

	<!-- page specific plugin styles -->

	<link rel="stylesheet" href="/ma/css/ace.min.css" />
	<link rel="stylesheet" href="/ma/css/ace-rtl.min.css" />
	<link rel="stylesheet" href="/ma/css/ace-skins.min.css" />


	<script src="/ma/js/ace-extra.min.js"></script>
	<script src="/ma/js/angular.min.js"></script>
	<script src="/ma/js/angular-cookies.min.js"></script>

</head>

	<body>
		<div class="navbar navbar-default" id="navbar">
		<script type="text/javascript">
				try {
					ace.settings.check('navbar', 'fixed')
				} catch(e) {}
			</script>
			<div class="navbar-container" id="navbar-container">
				<div class="navbar-header pull-left">
					<a href="#" class="navbar-brand">
						<small>
							<i class="icon-book"></i>
							面向研究团队的参考文献管理与服务分布式系统
						</small>
					</a>
					<!-- /.brand -->
				</div>
				<!-- /.navbar-header -->

				<div class="navbar-header pull-right" role="navigation">
					<ul class="nav ace-nav">

						<li class="light-blue">
							<a data-toggle="dropdown" href="#" class="dropdown-toggle">
								<img class="nav-user-photo" src="/ma/avatars/user.jpg" alt="Jason's Photo" />
								<span class="user-info">
									<small>欢迎,</small>
									登录
								</span>

								<i class="icon-caret-down"></i>
							</a>

							<ul class="user-menu pull-right dropdown-menu dropdown-yellow dropdown-caret dropdown-close">
								<li>
									<a href="#">
										<i class="icon-cog"></i> 设置
									</a>
								</li>

								<li>
									<a href="#">
										<i class="icon-user"></i> 简况
									</a>
								</li>

								<li class="divider"></li>

								<li>
									<a href="/ma/user/logout"  class="a_post">
										<i class="icon-off"></i> 登出
									</a>
								</li>
							</ul>
						</li>
					</ul>
					<!-- /.ace-nav -->
				</div>
				<!-- /.navbar-header -->
			</div>
			<!-- /.container -->
			
		</div>

		<div class="main-container" id="main-container">
			<script type="text/javascript">
				try{ace.settings.check('main-container' , 'fixed')}catch(e){}
			</script>

			<div class="main-container-inner">
				<a class="menu-toggler" id="menu-toggler" href="#">
					<span class="menu-text"></span>
				</a>

				<div class="sidebar" id="sidebar">
					<script type="text/javascript">
						try {
							ace.settings.check('sidebar', 'fixed')
						} catch(e) {}
					</script>

					<!-- #sidebar-shortcuts -->
					<ul class="nav nav-list">
						<li class="active">
							<a href="/ma/admin/memberAdd.html">
								<i class="icon-dashboard"></i>
								<span class="menu-text"> 团队成员 </span>
							</a>
						</li>
						<li>
							<a href="/ma/admin/email.html">
								<i class="glyphicon glyphicon-envelope"></i>
								<span class="menu-text"> 邮件系统 </span>
							</a>
						</li>
						<li>
							<a href="/ma/admin/message.html">
								<i class="glyphicon glyphicon-comment"></i>
								<span class="menu-text"> 短信系统 </span>
							</a>
						</li>
						<li>
							<a href="/ma/admin/professionalCode.html">
								<i class="glyphicon glyphicon-th-list"></i>
								<span class="menu-text"> 专业分类 </span>
							</a>
						</li>
						<li id="city">
							<a href="/ma/admin/city.html">
								<i class="icon-globe"></i>
								<span class="menu-text"> 地区城市 </span>
							</a>
						</li>
						<li>
							<a href="#" class="dropdown-toggle">
								<i class="glyphicon glyphicon-tasks"></i>
								<span class="menu-text"> 组织机构 </span>
								<b class="arrow icon-angle-down"></b>
							</a>

							<ul class="submenu">
								<li>
									<a href="#" class="dropdown-toggle">
										<i class="icon-leaf"></i> 出版商
										<b class="arrow icon-angle-down"></b>
									</a>
									<ul class="submenu">
										<li>
											<a href="/ma/admin/publisher1.html">
												<i class="icon-plus"></i> 国外出版商
											</a>
										</li>

										<li>
											<a href="/ma/admin/publisher2.html">
												<i class="icon-eye-open"></i> 国内出版商
											</a>
										</li>
									</ul>
								</li>
								<li>
									<a href="#" class="dropdown-toggle">
										<i class="icon-leaf"></i> 大学
										<b class="arrow icon-angle-down"></b>
									</a>
									<ul class="submenu">
										<li>
											<a href="/ma/admin/institution1.html">
												<i class="icon-plus"></i> 国外大学
											</a>
										</li>

										<li>
											<a href="/ma/admin/institution2.html">
												<i class="icon-eye-open"></i> 国内大学
											</a>
										</li>
									</ul>
								</li>

								<li>
									<a href="#" class="dropdown-toggle">
										<i class="icon-pencil"></i> 其他机构
										<b class="arrow icon-angle-down"></b>
									</a>

									<ul class="submenu">
										<li>
											<a href="#">
												<i class="icon-plus"></i> 国外其他机构
											</a>
										</li>

										<li>
											<a href="#">
												<i class="icon-eye-open"></i> 国内其他机构
											</a>
										</li>
									</ul>
								</li>
							</ul>
						</li>
						
						<li>
							<a href="/ma/admin/profile.html">
								<i class="glyphicon glyphicon-user"></i>
								<span class="menu-text"> 个人信息 </span>
							</a>
						</li>
						
						
					</ul>
					<!-- /.nav-list -->

					<div class="sidebar-collapse" id="sidebar-collapse">
						<i class="icon-double-angle-left" data-icon1="icon-double-angle-left" data-icon2="icon-double-angle-right"></i>
					</div>

					<script type="text/javascript">
						try {
							ace.settings.check('sidebar', 'collapsed')
						} catch(e) {}
					</script>
				</div>

				<div class="main-content">
					<div class="breadcrumbs" id="breadcrumbs">
						<script type="text/javascript">
							try{ace.settings.check('breadcrumbs' , 'fixed')}catch(e){}
						</script>

						<ul class="breadcrumb">
							<li>
								<i class="icon-home home-icon"></i>
								<a href="#">主页</a>
							</li>

							<li>
								<a href="#">研究团队</a>
							</li>
							<li>
								<a href="#">团队成员</a>
							</li>
						</ul><!-- .breadcrumb -->

						
					</div>

					<div class="page-content">
						<div class="page-header">
							<!--<h1>
								添加团队
								<small>
									<i class="icon-double-angle-right"></i>
									密码默认为团队号后8位
								</small>
							</h1>-->
							<div class="table-header" style="background-color:#ffb44b;color:black"> 团队名称：<span id="teamName1"></span>&nbsp;&nbsp;&nbsp;&nbsp;团队号：<span id="teamNo1"></span>
												</div>
						</div>

						<div class="row">
							<div  class="col-xs-12">
								<!-- PAGE CONTENT BEGINS -->
									<div class="row">
									<div class="col-xs-12">
									<div class="table-responsive">
											<div id="toolbar" class="btn-group row">
												<div class="col-md-4">
													<button id="btn_add" type="button" class="btn btn-default">
										       			<span class="glyphicon glyphicon-plus" aria-hidden="true"></span>增加成员
										    		</button>
										    	</div>

											</div>
											<table style="text-overflow: ellipsis;white-space: nowrap;" id="table-member">

											</table>

										</div>
								</div>
								</div>
							</div><!-- /.col -->
						</div><!-- /.row -->
					</div><!-- /.page-content -->
				</div><!-- /.main-content -->

				<div class="ace-settings-container" id="ace-settings-container">
					<div class="btn btn-app btn-xs btn-warning ace-settings-btn" id="ace-settings-btn">
						<i class="icon-cog bigger-150"></i>
					</div>

					<div class="ace-settings-box" id="ace-settings-box">
						<div>
							<div class="pull-left">
								<select id="skin-colorpicker" class="hide">
									<option data-skin="default" value="#438EB9">#438EB9</option>
									<option data-skin="skin-1" value="#222A2D">#222A2D</option>
									<option data-skin="skin-2" value="#C6487E">#C6487E</option>
									<option data-skin="skin-3" value="#D0D0D0">#D0D0D0</option>
								</select>
							</div>
							<span>&nbsp; 换肤</span>
						</div>

						

						<div>
							<input type="checkbox" class="ace ace-checkbox-2" id="ace-settings-add-container" />
							<label class="lbl" for="ace-settings-add-container">
								&nbsp;居中
								<b></b>
							</label>
						</div>
					</div>
				</div><!-- /#ace-settings-container -->
			</div><!-- /.main-container-inner -->

			<a href="#" id="btn-scroll-up" class="btn-scroll-up btn btn-sm btn-inverse">
				<i class="icon-double-angle-up icon-only bigger-110"></i>
			</a>
		</div><!-- /.main-container -->
		
		<div class="modal fade" id="add" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
			<div class="modal-dialog" role="document">
				<div class="modal-content">
					<div class="modal-header">
						<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
						<h4 class="modal-title" id="myModalLabel">新增</h4>
					</div>
					<div class="modal-body">

						<form ng-submit="submitForm()"  class="form-horizontal" role="form">
									<input type="hidden" name="openid" id="openid"
										   th:value="${#httpServletRequest.getParameter('UserName')}"/>
									<div class="form-group">
										<label class="col-sm-3 control-label no-padding-right" for="userNo"> 用户号 </label>

										<div class="col-sm-9">
											<input ng-model="userNo" type="text" id="userNo" class="col-xs-10 col-sm-5" required readonly/>
										</div>

									</div>

									<div class="space-4"></div>

									<div class="form-group">
										<label class="col-sm-3 control-label no-padding-right" for="passWord"> 密码 </label>

										<div class="col-sm-9">
											<input ng-model="passWord" type="password" required id="passWord" class="col-xs-10 col-sm-5" placeholder="请设置密码"/>&nbsp;<span style="color:red">*</span>
										</div>
									</div>

									<div class="space-4"></div>

									<div class="form-group">
										<label class="col-sm-3 control-label no-padding-right" for="userName"> 用户名 </label>

										<div class="col-sm-9">
											<input ng-model="userName"type="text" id="userName" placeholder="请输入用户名" class="col-xs-10 col-sm-5" />
											<span class="help-inline col-xs-12 col-sm-7">
												
											</span>
										</div>
									</div>

									<div class="space-4"></div>

									<div class="form-group">
										<label class="col-sm-3 control-label no-padding-right" for="teamNo"> 用户团队号 </label>

										<div class="col-sm-9">
											
											<input ng-model="userTeamNo" readonly="readonly" type="text" id="teamNo" class="col-xs-10 col-sm-5" />
											
										</div>
									</div>

									<div class="space-4"></div>

									<div class="form-group">
										<label class="col-sm-3 control-label no-padding-right" for="iDNo">身份证号</label>

										<div class="col-sm-9">
											<input ng-model="iDNo" class="input-sm" type="number"  id="iDNo" placeholder="请输入身份证号" style ="width: 41.6%;"/>
											

											
										</div>
									</div>

									<div class="form-group">
										<label class="col-sm-3 control-label no-padding-right" for="userPhone">手机号码</label>

										<div class="col-sm-9">
											<div class="clearfix">
												<input ng-model="userPhone" class="input-sm" type="number"  id="userPhone" placeholder="请输入手机号码" style ="width: 41.6%;"/>
											</div>

										</div>
									</div>

									<div class="form-group">
										<label class="col-sm-3 control-label no-padding-right">Email</label>

										<div class="col-sm-9">
											
												<input ng-model="userEmail" class="input-sm"  type="email" id="userEmail" placeholder="请输入邮箱"  style ="width: 41.6%;"/>

										</div>
									</div>
									
									<div class="form-group">
										<label class="col-sm-3 control-label no-padding-right">用户角色</label>

										<div class="col-sm-9">
											
<!--												<input ng-model="userRole" required="required" class="input-sm"  type="text" id="form-field-icon-2" placeholder="用户角色" />-->

											<select id="userRole" class="input-sm"  style ="width: 20%;">
												<option value="-1" selected>==请选择用户角色==</option>
												<option value="3">超级用户</option>
												<option value="4">高级用户</option>
												<option value="5">中级用户</option>
											</select> <span style="color:red">*</span>

											
										</div>
									</div>

									<div class="form-group">
										<label class="col-sm-3 control-label no-padding-right" for="userNote">备注</label>

										<div class="col-sm-9">
											<textarea ng-model="note" rows="3" class="col-xs-10 col-sm-5" id="userNote" placeholder="请输入备注"></textarea>
										</div>
									</div>

									<div class="space-4"></div>

									<div class="hr hr-24"></div>

								</form>

					</div>
					<div class="modal-footer">
						<button type="button" id="submit" class="btn btn-primary" data-dismiss="modal"><span class="glyphicon glyphicon-floppy-disk" aria-hidden="true"></span>保存</button>
						<button type="button" class="btn btn-default" data-dismiss="modal"><span class="glyphicon glyphicon-remove" aria-hidden="true"></span>关闭</button>
					</div>
				</div>
			</div>
		</div>
		
		<div class="modal fade" id="edit" tabindex="-1" role="dialog" aria-labelledby="myModalLabel1">
			<div class="modal-dialog" role="document">
				<div class="modal-content">
					<div class="modal-header">
						<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
						<h4 class="modal-title" id="myModalLabel1">编辑</h4>
					</div>
					<div class="modal-body">

						<form>
							<div style="display: none;" class="form-group">
								<label for="cityID">cityID</label>
								<input type="text" class="form-control" id="cityID" placeholder="cityID">
							</div>
							<div class="form-group">
								<select id="region" class="form-control">
									<option>区域</option>
									<option>美国</option>
									<option>中国</option>
									<option>欧洲</option>
									<option>亚洲</option>
									<option>其他</option>
								</select>
							</div>
							<div class="form-group">
								<label for="stateName2">中文国家或中美国省州名</label>
								<input type="text" class="form-control" id="stateName2" placeholder="中文国家或中美国省州名">
							</div>
							<div class="form-group">
								<label for="stateName1">西文国家或中美国省州名</label>
								<input type="text" class="form-control" id="stateName1" placeholder="西文国家或中美国省州名">
							</div>

							<div class="form-group">
								<label for="stateAbbr">国家或州名缩写</label>
								<input type="text" class="form-control" id="stateAbbr" placeholder="国家或州名缩写">
							</div>

							<div class="row form-inline form-group">
								<div class="col-md-6">
									<label for="cityName2">中文城市名：</label>
									<input type="text" class="form-control" id="cityName2" placeholder="中文城市名">
								</div>
								<div class="col-md-6">
									<label for="cityName1">西文城市名：</label>
									<input type="text" class="form-control" id="cityName1" placeholder="西文城市名">
								</div>
							</div>

						</form>

					</div>
					<div class="modal-footer">
						<button type="button" class="btn btn-default" data-dismiss="modal"><span class="glyphicon glyphicon-remove" aria-hidden="true"></span>关闭</button>
						<button type="button" id="btn_submit" class="btn btn-primary" data-dismiss="modal"><span class="glyphicon glyphicon-floppy-disk" aria-hidden="true"></span>保存</button>
					</div>
				</div>
			</div>
		</div>
		
		
		<script src="/ma/js/jquery-2.0.3.min.js"></script>

		<script type="text/javascript">
			if("ontouchend" in document) document.write("<script src='/ma/js/jquery.mobile.custom.min.js'>"+"<"+"/script>");
		</script>

		<!--[if lte IE 8]>
		  <script src="/ma/js/excanvas.min.js"></script>
		<![endif]-->

		<script src="../js/bootstrap.min.js"></script>
		<script src="../js/bootstrap-table.js"></script>
		<script src="../js/bootstrap-editable.js"></script>
		<script src="../js/bootstrap-table-zh-CN.js"></script>
		<script src="../js/typeahead-bs2.min.js"></script>

		<script src="../js/ace-elements.min.js"></script>
		<script src="../js/ace.min.js"></script>
		<script src="/ma/mainjs/auth.js"></script>

		<!-- inline scripts related to this page -->
		<script>
			$(function () {
				judgeAuthority();
			})
		$('#table-member').bootstrapTable({
			url: '/ma/user/getUsersByTeam',
			method: 'POST', //请求方式（*）
			contentType : 'application/x-www-form-urlencoded; charset=UTF-8',
			toolbar: '#toolbar', //工具按钮用哪个容器
			striped: true, //是否显示行间隔色
			cache: false, //是否使用缓存，默认为true，所以一般情况下需要设置一下这个属性（*）
			pagination: true, //是否显示分页（*）
			sortable: true, //是否启用排序
			sortOrder: "desc", //排序方式
			sidePagination: "client", //分页方式：client客户端分页，server服务端分页（*）
			pageNumber: 1, //初始化加载第一页，默认第一页
			pageSize: 10, //每页的记录行数（*）
			pageList: [10, 25, 50, 100], //可供选择的每页的行数（*）
			search: true, //是否显示表格搜索，此搜索是客户端搜索，不会进服务端，所以，个人感觉意义不大
			strictSearch: true,
			showColumns: true, //是否显示所有的列
			showRefresh: true, //是否显示刷新按钮
			minimumCountColumns: 2, //最少允许的列数
			clickToSelect: true, //是否启用点击选中行
			height: 500, //行高，如果没有设置height属性，表格自动根据记录条数觉得表格高度
			uniqueId: "userNo", //每一行的唯一标识，一般为主键列
			showToggle: true, //是否显示详细视图和列表视图的切换按钮
			cardView: false, //是否显示详细视图
			detailView: false,
			editable: true,
			rowStyle: function(row, index) {
				//这里有5个取值代表5中颜色['active', 'success', 'info', 'warning', 'danger'];
				var strclass = "";
				if(row.ORDER_STATUS == "待排产") {
					strclass = 'success'; //还有一个active
				} else if(row.ORDER_STATUS == "已删除") {
					strclass = 'danger';
				} else {
					return {};
				}
				return {
					classes: strclass
				}
			},
			columns: [{
				field: 'userNo',
				title: '成员号',
				align: 'center',
				sortable: true
			},{
				field: 'userName',
				title: '成员名称',
				align: 'center',
				sortable: true
			}, {
				field: 'userPhone',
				title: '手机号码',
				align: 'center',
				sortable: true
			}, {
				field: 'userEmail',
				title: 'email',
				align: 'center',
				sortable: true
			}, {
				field: 'userRoleName',
				title: '成员角色',
				align: 'center',
				sortable: true

			},{
				title: '操作',
				field: 'id',
				align: 'center',
				formatter: function(value, row, index) {
					var e = '<a class = "edit" href="#" mce_href="#"><i class="icon-pencil bigger-130"></i></i></a> ';
					var d = '<a class = "remove" href="#" mce_href="#" ><i class="icon-trash bigger-130"></i></a> ';
					return e + d;
				},
				events: 'operateEvents'
			}]

		});

		window.operateEvents = {
			'click .edit': function(e, value, row, index) {
				/*$.cookie('teamNo', row.teamNo);
				window.location.href = 'teamedit.html';*/
				$("#userName").val(row.userName1);
				$("#userPhone").val(row.userPhone1);
				$("#userEmail").val(row.userEmail1);
				$("#userRole").val(row.userRole1);
				$('#edit').modal();

			},
			'click .remove': function(e, value, row, index) {
				/*$("#myModal .confirm").attr("onclick","confirmRemove("+row.teamNo+");");*/
				$('#myModal').modal();
				console.log(row);
				$("#myModal .confirm").click(function(e) {
					$.ajax({
						type: "PUT",
						contentType: "application/json",
						data: '{"teamNo":"' + row.teamNo + '","ifuse":"n"}',
						dataType: 'json',
						url: '/ma/team',
						success: function(data) {
							$('#table-member').bootstrapTable('remove', {
								field: 'userNo',
								values: [row.teamNo]
							});
						}
					});
				})

			}

		};
		
		$(document).ready(function(){
			userNo=""
			teamNo=""
			$.ajax({
				type : "Post",
				contentType : "application/json",
				dataType : 'json',
				url : '/ma/user/getUserAndTeam',
				success : function(data) {
					console.log(data.teamNo);
					userNo = data.userNo;
					teamNo = data.teamNo;
					$('#teamNo1').text(data.teamNo);
					$('#teamName1').text(data.teamName);
				}
			}); 
			$("#btn_add").click(function() {
                $.ajax({
                    type : "post",
                    url : '/ma/user/getNewUserNo',
                    //contentType: "application/json;charset=utf-8",
                    data:{
                        "teamNo": teamNo
                    },
                    dataType : 'JSONP',

                    success : function(data) {
                        alert("suc "+data);
                        console.log(data)
                        //userNo = data.userNo
                        //teamNo = data.teamNo
                        //$('#teamNo1').text(data.teamNo)
                        //$('#teamName1').text(data.teamName)
                    }, error:function (message) {
                        var result = eval(message).responseText;

                        if (result !== "-1") {
                            $('#add').modal();
                            $('#userNo').val(result.replace(/\"/g, ""));
                            $('#teamNo').val(teamNo);
                        }else{
                            alert("增加失败");
                        }
                    }
                });

			});
		}); 
		
	
			$('#submit').click(function() {
				var userNo = $("#userNo").val();
				var passWord = $("#passWord").val();
				var userName = $("#userName").val();
				var teamNo = $("#teamNo").val();
				var iDNo = $("#iDNo").val();
				var userPhone = $("#userPhone").val();
				var userEmail = $("#userEmail").val();
				var userRole = $("#userRole").val();
				var userNote = $("#userNote").val();
				$.ajax({
					type: "POST",
					url: "/ma/user/addUser",
					contentType: "application/json;charset=utf-8",
					data:JSON.stringify({
						"userNo": userNo,
						"password" : passWord,
						"userName" : userName,
						"userTeamNo" : teamNo,
						"iDNo": iDNo,
						"userPhone" : userPhone,
						"userEmail" : userEmail,
						"userRole" : userRole,
						"note": userNote
					}),
					dataType: "json",
					success:function (message) {
						// JSON.stringify(message) 将resultMap转换成字典 === eval(message)
						//$('#register').modal();
						alert("注册成功");
						document.getElementById("passWord").value = "";
						document.getElementById("userName").value = "";
						document.getElementById("iDNo").value = "";
						document.getElementById("userPhone").value = "";
						document.getElementById("userEmail").value = "";
						document.getElementById("userNote").value = "";
					},
					error:function (message) {
						alert("注册失败\n错误信息：\n"+JSON.stringify(message));
					}
				});
			});

			$('#reset').click(function(e) {
				document.getElementById("passWord").value = "";
				document.getElementById("userName").value = "";
				document.getElementById("iDNo").value = "";
				document.getElementById("userPhone").value = "";
				document.getElementById("phoneNum").value = "";
				document.getElementById("userEmail").value = "";
				document.getElementById("userNote").value = "";
			});
		</script>
	<!--<div style="display:none"><script src='http://v7.cnzz.com/stat.php?id=155540&web_id=155540' language='JavaScript' charset='gb2312'></script></div>-->
</body>
</html>
